<script>
export default {
  name: "Myinput",
  props: ["type", "value"],
  computed: {
    newValue: {
      get({ value }) {
        console.log("get", value);
        return value;
      },
      set(val) {
        console.log("set", val);
        this.$emit("input", val);
      },
    },
  },
  methods: {
    onInputHandle(val) {
      console.log(val);
      this.newValue = val;
    },
  },
  render(h) {
    return h("el-input", {
      attrs: {
        ...this.$attrs,
      },
      props: {
        type: this.type,
        value: this.newValue,
      },
      on: {
        input: this.onInputHandle,
      },
    });
  },
};
</script>